<nav class="navbar navbar-default">
    <div class="container-fluid">
        <!-- Brand and toggle get grouped for better mobile display -->
        <div class="navbar-header">
            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse"
                    data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
{#            <a class="navbar-brand" href={% url 'index' %}>首页</a>#}
        </div>

        <!-- Collect the nav links, forms, and other content for toggling -->
        <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
            <ul class="nav navbar-nav">
                <li id="home" class="active"><a href={% url 'index' %}>首页<span class="sr-only">(current)</span></a></li>
                <li id="stock"><a href={% url 'stock' %}>个股<span class="sr-only">(current)</span></a></li>
                <li id="industry"><a href={% url 'industry' %}>行业<span class="sr-only">(current)</span></a></li>
                <li id="stock_index"><a href={% url 'stock_index' %}>指数<span class="sr-only">(current)</span></a></li>
                <li id="company"><a href={% url 'company' %}>公司<span class="sr-only">(current)</span></a></li>
                <li id="concept"><a href={% url 'concept' %}>概念<span class="sr-only">(current)</span></a></li>
                <li id="qa_chat"><a href={% url 'qa_chat' %}> 智能问答 <span class="sr-only">(current)</span></a></li>
            </ul>

            <ul class="nav navbar-nav navbar-right">
                {% if request.user_obj %}
                    <li class="dropdown">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true"
                           aria-expanded="false">{{ request.user_obj.username }} <span class="caret"></span></a>
                        <ul class="dropdown-menu">
                            <li><a href="#">管理中心</a></li>
                            <li><a href="{% url 'logout' %}">退 出</a></li>
                        </ul>
                    </li>
                {% else %}
                    <li><a href="{% url 'login' %}">登录</a></li>
                    <li><a href="{% url 'register' %}">注册</a></li>
                {% endif %}


            </ul>
        </div><!-- /.navbar-collapse -->
    </div><!-- /.container-fluid -->
</nav>

